package com.example.searchcenter.helper;


import com.example.searchcenter.center.AlbumsFragment;
import com.example.searchcenter.center.IntroduceFragment;
import com.example.searchcenter.center.ActivitiesFragment;
import com.example.searchcenter.center.MapsFragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class TabsPagerAdapter extends FragmentPagerAdapter {

	public TabsPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int index) {

		switch (index) {
		case 0:
			// Maps fragment activity
			return new MapsFragment();
		case 1:
			// Introduce fragment activity
			return new IntroduceFragment();
		case 2:
			// Activity fragment activity
			return new AlbumsFragment();
		case 3: 
			return new ActivitiesFragment();
		}

		return null;
	}

	@Override
	public int getCount() {
		// get item count - equal to number of tabs
		return 4;
	}

}
